﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Net;
using System.Text;
using System.IO;
using System.Runtime.Serialization.Json;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System.Collections;
using BuscoPre.Domain;
using BuscoPre.UI.Models;
using BuscoPre.Repository;
using BuscoPre.UI.ViewModels;

namespace BuscoPre.UI.Controllers
{
	/// <summary>
	/// Controlador principal del website.
	/// </summary>
	[HandleError]
	public class HomeController : Controller
	{
		/// <summary>
		/// Accion principal de la home, tambien obtiene las categorias para indexar en el buscador.
		/// </summary>
		/// <returns></returns>
		public ActionResult Index()
		{
			var viewModel = new CategoriesViewModel
			{
				Categories = CategoriesDao.GetAll()
			};

			return View(viewModel);
		}

		/// <summary>
		/// Acerca de BuscoPre.Com
		/// </summary>
		/// <returns></returns>
		public ActionResult About()
		{
			return View();
		}
	}
}
